﻿using System.Windows.Controls;
using Officer2010.Infrastructure.ViewServices;
using nRoute.ViewServices;

namespace Officer2010
{
    [MapViewService(typeof(IMessageViewService), "ShellShowMessageViewService", Lifetime = ViewServiceLifetime.DiscoveredInstance)]
	public partial class Shell 
        : UserControl, IMessageViewService
	{
        private const string MESSAGE_PARMKEY = "Message";
        private const string ACKN_MSG_FORMAT = "Acknowledging request to '{0}'";

        public Shell()
		{
			InitializeComponent();
		}

#region IShowMessageViewService Members

        void IMessageViewService.ShowMessage(string message)
        {
            if (string.IsNullOrEmpty(message)) return;

            BallonText.Text = string.Format(ACKN_MSG_FORMAT, message);
            BallonStoryboard.Begin();
        }

#endregion

    }
}